package cn.com.huzo.model.entities.purchase;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.util.Date;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 非材料花费明细实体类
 *
 * @author 吴旭
 */
public class NonMaterialCostLinesEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = 3587306095089339077L;
    private String LinesId;
    private Long HeaderId;
    private String StyleNo;
    private String Cause;           // 花费原因
    private Float CostAmount;       // 花费金额   
    private String InvoiceNo;       // 发票号
    private Date InvoiceDate;
    private Double TaxRate;         // 税率
    private Long PoId;              // 采购合同标识   
    private String PoNo;            // 采购合同号 
    private Long SupplierId;        // 材料供应商    
    private String SupplierName;    // 

    public String getLinesId() {
        return LinesId;
    }

    public void setLinesId(String LinesId) {
        this.LinesId = LinesId;
    }

    public Long getHeaderId() {
        return HeaderId;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public String getStyleNo() {
        return StyleNo;
    }

    public void setStyleNo(String StyleNo) {
        this.StyleNo = StyleNo;
    }

    public String getCause() {
        return Cause;
    }

    public void setCause(String Cause) {
        this.Cause = Cause;
    }

    public Float getCostAmount() {
        return CostAmount;
    }

    public void setCostAmount(Float CostAmount) {
        this.CostAmount = CostAmount;
    }

    public String getInvoiceNo() {
        return InvoiceNo;
    }

    public void setInvoiceNo(String InvoiceNo) {
        this.InvoiceNo = InvoiceNo;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy、MM", timezone = "GMT+8")
    public Date getInvoiceDate() {
        return InvoiceDate;
    }

    public void setInvoiceDate(Date InvoiceDate) {
        this.InvoiceDate = InvoiceDate;
    }

    public Double getTaxRate() {
        return TaxRate;
    }

    public void setTaxRate(Double TaxRate) {
        this.TaxRate = TaxRate;
    }

    public Long getPoId() {
        return PoId;
    }

    public void setPoId(Long PoId) {
        this.PoId = PoId;
    }

    public String getPoNo() {
        return PoNo;
    }

    public void setPoNo(String PoNo) {
        this.PoNo = PoNo;
    }

    public Long getSupplierId() {
        return SupplierId;
    }

    public void setSupplierId(Long SupplierId) {
        this.SupplierId = SupplierId;
    }

    public String getSupplierName() {
        return SupplierName;
    }

    public void setSupplierName(String SupplierName) {
        this.SupplierName = SupplierName;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof NonMaterialCostLinesEntity)) {
            return false;
        }

        final NonMaterialCostLinesEntity that = (NonMaterialCostLinesEntity) o;

        return new EqualsBuilder()
                .append(this.getLinesId(), that.getLinesId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getLinesId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
